Skip to main content

Area

Easily measure an area on your document or plan.

API

startCreate

Create an area. You can select between Measure, Annotations, Perimeter and Calibration.

ParamTypeDescription
toolstringSelect the desired tool
[single]boolSelect true to make a single measure, false to make a multi-point measure
[color]stringChange the color of the annotation tool
[showLength]boolToogle visibility of the length drawing of the measure - area and perimeter tool
[single]boolSelect true to make a single measure, false to make a multi-point measure
[guid]stringSet a group_guid if you want to add a pin to an existing group

Available tool options:

  • annotation: Select the annotation tool.
  • measure: Select measure tool.
  • area: Select area tool.
  • perimeter: Select perimeter tool.
  • calibration: Set a calibration to match the scale of the plan on the pdf.

Example

TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "area",
showLength: "false",
},
callback: myfunc,
});

setPageAnnotation

Add a JSON annotation on the PDF. The command parse the Json with the className and draw the annotation on the correct page.

ParamTypeDescription
drawingArray.JSONArray of json annotations

Example

TFTPDFGadget.callCommand({
name: "stopCreate",
callback: myfunc,
});
CAUTION
  • Call this command with a JSON object to load 1 annotation.
  • Call this command with an array of x JSON object to load all of them.
TFTPDFGadget.callCommand({
name: "setPageAnnotation",
args: { drawing: { area_1 } },
callback: myfunc,
});

stopCreate

Stop the current tool.

Example

TFTPDFGadget.callCommand({
name: "stopCreate",
callback: myfunc,
});

deleteAnnotation

Delete annotation with his GUID.

ParamTypeDescription
guidstringGUID of the annotations group.

Example

TFTPDFGadget.callCommand({
name: "deleteAnnotation",
args: {
guid: "4a4f720b64b7-4170-aa1b-80c8fdb595d3",
unique_guid: "xxxxxxxxx-xxxxx-xxxxx",
},
callback: myfunc,
});

setSelection

Select an area

ParamTypeDescription
guidstringGUID of the area.

Example

TFTPDFGadget.callCommand({
name: "setSelection",
args: { guid: "4a4f720b-64b7-4170-aa1b-80c8fdb595d3" },
callback: myfunc,
});

resetSelection

Reset the current selection.

ParamTypeDescription
guidstringGUID of the annotations group.

Example

TFTPDFGadget.callCommand({
name: "resetSelection",
args: { guid: "4a4f720b-64b7-4170-aa1b-80c8fdb595d3" },
callback: myfunc,
});

moveAnnotation

Move the desired annotation - Start the state to edit position, stop with stopMoveAnnotation.

Example

TFTPDFGadget.callCommand({ name: "moveAnnotation", callback: myfunc });

stopMoveAnnotation

Disable the moveAnnotation mode.

Example

TFTPDFGadget.callCommand({
name: "stopMoveAnnotation",
callback: myfunc,
});